<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>transform</title>
    <link rel="stylesheet" href="../vendor/bootstrap/css/bootstrap.min.css">
</head>

<body>

    <div class="container">
        <h1>遮罩 mask</h1>
        <ul>
            <li>参考示例: 注意 stop-opacity 透明度</li>
        </ul>
    </div>

    <div class="container">
        <svg width="640" height="300" xmlns="http://www.w3.org/2000/svg">
            <defs>
                <linearGradient id="Gradient">
                    <stop offset="0" stop-color="white" stop-opacity="0" />
                    <stop offset="1" stop-color="white" stop-opacity="1" />
                </linearGradient>
                <mask id="Mask">
                    <rect x="0" y="0" width="200" height="200" fill="url(#Gradient)" />
                </mask>
            </defs>

            <rect x="0" y="0" width="200" height="200" fill="green" />
            <rect x="0" y="0" width="200" height="200" fill="red" mask="url(#Mask)" />
        </svg>
    </div>

    <div class="container">
        <svg width="640" height="300" xmlns="http://www.w3.org/2000/svg">
            <defs>
                <radialGradient id="Gradient2">
                    <stop offset="0" stop-color="white" stop-opacity="1" />
                    <stop offset=".8" stop-color="white" stop-opacity=".7" />
                    <stop offset="1" stop-color="white" stop-opacity="0" />
                </radialGradient>
                <mask id="Mask2">
                    <circle cx="160" cy="170" r="60" fill="url(#Gradient2)" />
                </mask>
            </defs>
            <image x="100" y="100" width="128" height="146" fill="red" mask="url(#Mask2)" xlink:href="/images/mdn-logo.png" />
        </svg>
    </div>

</body>

</html>